<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>sell show</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<script type="text/javascript" src="/Machine/js/jquery-1.7.2.js">
		</script>
		<link rel="stylesheet" type="text/css" href="/Machine/css/show.css">
		
		<script type="text/javascript">
		
		function lookModel(obj)
	{
		obj.href="/Machine/user/lookModel.action?path=${componentpart.path}";
	}
		
		function submitForm(obj){
			var button = $.trim($(obj).val());
			
			if(button == "我要购买"){
				if(window.confirm('你确定要交易吗？')){
					$("#orderForm").submit();
	                 return true;
	              }else{
	                 return false;
	             }
			}
			if(button == "我要询价"){
				
				$("#xunjia_tr1").toggleClass("xunjia_tr");
				$("#xunjia_tr2").toggleClass("xunjia_tr");
				$("#xunjia_tr3").toggleClass("xunjia_tr");
				
			}
			
		   if(button == "提交询价"){
			   if(window.confirm('你确定要提交询价单吗？')){
				    $("#orderForm").attr("action","/Machine/user/addPriceOrderAction.action");
				    //alert($("#orderForm").attr("action"));
					$("#orderForm").submit();
	                return true;
	              }else{
	                 return false;
	             }
			}
			
			
			
			
		}
		
		</script>

	</head>

	<body style="text-align:center;" >
		<jsp:include page="header.jsp"></jsp:include>
		<div class="m">
			<div class="left_box">
				<div class="pos">
				<strong>产品简介</strong>
				</div>
				<div class="b10 c_b"></div>

				<table width="100%">
					<tbody>
						<tr>
							<td width="10">
							</td>

							<td>
								<table width="100%">
									<tbody>
										<tr>
											<td colspan="3">
												<h1 class="title_trade">
													
												</h1>
											</td>
										</tr>
										<tr>
											<td width="250" valign="top">
												<div class="album">
													<table width="100%" cellspacing="0" cellpadding="0">
														<tbody>
															<tr align="center">
																<td width="250" valign="top">
																	<div>
																		<span id="abm"> <img id="DIMG" src="${componentpart.engineeringdrawing}" width="200px" height="300px">
																		</span>
																	</div>
																</td>
															</tr>
															
															<tr align="center">
																<td height="30" >
																	<img width="16" height="16" 
																		src="">
																		<a href="#" onclick="lookModel(this);" target="_blank">点击查看3D模型</a>
																	
																</td>
															</tr>
														</tbody>
													</table>
												</div>
											</td>
											<td width="15">
											</td>
											<td valign="top">
												<div id="imgshow" style="display: none;">
													<img
														src="">
												</div>
												<form action="/Machine/user/addOrderAction.action" method="post" id="orderForm" name="orderForm">
												<table width="100%" cellspacing="5" cellpadding="5">
													<tbody>
														<tr>
															<td class="f_dblue">
																名称：
															</td>
															<td>
															<input type="hidden" name="orderForm.componentname" value="${componentpart.name}">
															<input type="hidden" name="orderForm.componentid" value="${componentpart.id}">
															<input type="hidden" name="orderForm.providerid" value="${componentpart.providerid}">
															<input type="hidden" name="orderForm.providerName" value="${componentpart.providername}">
															<input type="hidden" name="orderForm.buyName" value="${username}">
															<input type="hidden" name="orderForm.buyid" value="${userid}">
															
															<input type="hidden" name="priceOrder.providerid" value="${componentpart.providerid}">
															<input type="hidden" name="priceOrder.providerName" value="${componentpart.providername}">
															<input type="hidden" name="priceOrder.buyid" value="${userid}">
															<input type="hidden" name="priceOrder.buyName" value="${username}">
															<input type="hidden" name="priceOrder.componentid" value="${componentpart.id}">
															<input type="hidden" name="priceOrder.componentName" value="${componentpart.name}">
															<input type="hidden" name="priceOrder.providerprice" value="${componentpart.price}">
															
												
																${componentpart.name}
															</td>
														</tr>
														
														
														
														<tr>
															<td class="f_dblue">
																价格：
															</td>
															<td>
															<input type="hidden" name="orderForm.unitprice" value="${componentpart.price}">
															${componentpart.price}
															</td>
														</tr>
														
														<tr>
															<td class="f_dblue">
																库存数量：
															</td>
															<td>
															${componentpart.stockamount}
															</td>
														</tr>
														
														<tr>
															<td class="f_dblue">
																其他：
															</td>
															<td>
															${componentpart.other}
															</td>
														</tr>
														
														<tr>
															<td class="f_dblue">
																购买数量：
															</td>
															<td>
															<input type="text" value="${1}" name="orderForm.amount"/>
															</td>
														</tr>
														<tr>
															<td class="f_dblue">
																购买说明：
															</td>
															<td>
															<textarea rows="" cols="" name="orderForm.info">
															
															</textarea>
															</td>
														</tr>
														<tr id="xunjia_tr1" class="xunjia_tr">
															<td class="f_dblue">
																我的理想价格：
															</td>
															<td>
															<input type="text"  name="priceOrder.buyprice"/>
															</td>
														</tr>
														<tr id="xunjia_tr2" class="xunjia_tr">
															<td class="f_dblue">
																我的说明：
															</td>
															<td>
															<textarea rows="" cols="" name="priceOrder.info">
															
															</textarea>
															</td>
														</tr>
														<tr id="xunjia_tr3" class="xunjia_tr">
															<td>
															<input type="button" class="my-btn-big" onclick="submitForm(this);"  value="提交询价"/>
															</td>
														</tr>
														
														<tr>
															<td colspan="2">
															<input type="button" class="my-btn-big" onclick="submitForm(this);" value="我要询价"/>
															</td>
															<td colspan="2">
															<input type="button" class="my-btn-big" onclick="submitForm(this);"  value="我要购买"/>
															</td>
														</tr>

													</tbody>
												</table>
												</form>
											</td>

											<td width="10">
											</td>
											<td width="300" valign="top">
												
												<div id="contact" class="contact_body">
													<ul>
														<li class="f_b t_c"
															style="padding: 3px 0 5px 0; font-size: 14px;">
															供应商信息
														</li>

														<li style="padding-top: 6px; padding-bottom: 6px;">
															<span>联系人</span> ${provider.username}
															
														</li>
														<li>
															<span>公司</span>
															${provider.company}
														</li>
														<li>
															<span>电话</span>
															${provider.tel}
														</li>
														
														<li title="">
															<span>等级</span>
															 ${provider.supplierClass}
														</li>
														
													</ul>
												</div>
											</td>
											<td width="10">
											</td>

										</tr>



									</tbody>
								</table>
							</td>
					</tbody>
				</table>
			</div>
		</div>

		<div class="m">
			<div class="b10">
				&nbsp;
			</div>

		

</div>

		<jsp:include page="footer.jsp"></jsp:include>
	</body>
</html>
